package com.yf1706.bean;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;


/**
 * The persistent class for the social_security_type database table.
 * 
 */
@Entity
@Table(name="social_security_type")
@NamedQuery(name="SocialSecurityType.findAll", query="SELECT s FROM SocialSecurityType s")
public class SocialSecurityType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="social_security_type_id")
	private int socialSecurityTypeId;

	@Column(name="company_accumulation_fund_rate")
	private double companyAccumulationFundRate;

	@Column(name="company_childbirth_insurance_rate")
	private double companyChildbirthInsuranceRate;

	@Column(name="company_employment_injury_insurance_rate")
	private double companyEmploymentInjuryInsuranceRate;

	@Column(name="company_endowment_insurance_rate")
	private double companyEndowmentInsuranceRate;

	@Column(name="company_medical_insurance_rate")
	private double companyMedicalInsuranceRate;

	@Column(name="company_unemployment_insurance_rate")
	private double companyUnemploymentInsuranceRate;

	@Column(name="person_accumulation_fund_rate")
	private double personAccumulationFundRate;

	@Column(name="person_childbirth_insurance_rate")
	private double personChildbirthInsuranceRate;

	@Column(name="person_employment_injury_insurance_rate")
	private double personEmploymentInjuryInsuranceRate;

	@Column(name="person_endowment_insurance_rate")
	private double personEndowmentInsuranceRate;

	@Column(name="person_medical_insurance_rate")
	private double personMedicalInsuranceRate;

	@Column(name="person_unemployment_insurance_rate")
	private double personUnemploymentInsuranceRate;

	@Column(name="social_security_type_name")
	private String socialSecurityTypeName;

	//bi-directional many-to-one association to SocialSecurity
	@OneToMany(mappedBy="socialSecurityType")
	@JSONField(serialize = false)
	private List<SocialSecurity> socialSecurities;

	public SocialSecurityType() {
	}

	public SocialSecurityType(int socialSecurityTypeId, double companyAccumulationFundRate,
			double companyChildbirthInsuranceRate, double companyEmploymentInjuryInsuranceRate,
			double companyEndowmentInsuranceRate, double companyMedicalInsuranceRate,
			double companyUnemploymentInsuranceRate, double personAccumulationFundRate,
			double personChildbirthInsuranceRate, double personEmploymentInjuryInsuranceRate,
			double personEndowmentInsuranceRate, double personMedicalInsuranceRate,
			double personUnemploymentInsuranceRate, String socialSecurityTypeName) {
		super();
		this.socialSecurityTypeId = socialSecurityTypeId;
		this.companyAccumulationFundRate = companyAccumulationFundRate;
		this.companyChildbirthInsuranceRate = companyChildbirthInsuranceRate;
		this.companyEmploymentInjuryInsuranceRate = companyEmploymentInjuryInsuranceRate;
		this.companyEndowmentInsuranceRate = companyEndowmentInsuranceRate;
		this.companyMedicalInsuranceRate = companyMedicalInsuranceRate;
		this.companyUnemploymentInsuranceRate = companyUnemploymentInsuranceRate;
		this.personAccumulationFundRate = personAccumulationFundRate;
		this.personChildbirthInsuranceRate = personChildbirthInsuranceRate;
		this.personEmploymentInjuryInsuranceRate = personEmploymentInjuryInsuranceRate;
		this.personEndowmentInsuranceRate = personEndowmentInsuranceRate;
		this.personMedicalInsuranceRate = personMedicalInsuranceRate;
		this.personUnemploymentInsuranceRate = personUnemploymentInsuranceRate;
		this.socialSecurityTypeName = socialSecurityTypeName;
	}

	@Override
	public String toString() {
		return "SocialSecurityType [socialSecurityTypeId=" + socialSecurityTypeId + ", companyAccumulationFundRate="
				+ companyAccumulationFundRate + ", companyChildbirthInsuranceRate=" + companyChildbirthInsuranceRate
				+ ", companyEmploymentInjuryInsuranceRate=" + companyEmploymentInjuryInsuranceRate
				+ ", companyEndowmentInsuranceRate=" + companyEndowmentInsuranceRate + ", companyMedicalInsuranceRate="
				+ companyMedicalInsuranceRate + ", companyUnemploymentInsuranceRate=" + companyUnemploymentInsuranceRate
				+ ", personAccumulationFundRate=" + personAccumulationFundRate + ", personChildbirthInsuranceRate="
				+ personChildbirthInsuranceRate + ", personEmploymentInjuryInsuranceRate="
				+ personEmploymentInjuryInsuranceRate + ", personEndowmentInsuranceRate=" + personEndowmentInsuranceRate
				+ ", personMedicalInsuranceRate=" + personMedicalInsuranceRate + ", personUnemploymentInsuranceRate="
				+ personUnemploymentInsuranceRate + ", socialSecurityTypeName=" + socialSecurityTypeName
				+ ", socialSecurities=" + socialSecurities + "]";
	}

	public int getSocialSecurityTypeId() {
		return this.socialSecurityTypeId;
	}

	public void setSocialSecurityTypeId(int socialSecurityTypeId) {
		this.socialSecurityTypeId = socialSecurityTypeId;
	}

	public double getCompanyAccumulationFundRate() {
		return this.companyAccumulationFundRate;
	}

	public void setCompanyAccumulationFundRate(double companyAccumulationFundRate) {
		this.companyAccumulationFundRate = companyAccumulationFundRate;
	}

	public double getCompanyChildbirthInsuranceRate() {
		return this.companyChildbirthInsuranceRate;
	}

	public void setCompanyChildbirthInsuranceRate(double companyChildbirthInsuranceRate) {
		this.companyChildbirthInsuranceRate = companyChildbirthInsuranceRate;
	}

	public double getCompanyEmploymentInjuryInsuranceRate() {
		return this.companyEmploymentInjuryInsuranceRate;
	}

	public void setCompanyEmploymentInjuryInsuranceRate(double companyEmploymentInjuryInsuranceRate) {
		this.companyEmploymentInjuryInsuranceRate = companyEmploymentInjuryInsuranceRate;
	}

	public double getCompanyEndowmentInsuranceRate() {
		return this.companyEndowmentInsuranceRate;
	}

	public void setCompanyEndowmentInsuranceRate(double companyEndowmentInsuranceRate) {
		this.companyEndowmentInsuranceRate = companyEndowmentInsuranceRate;
	}

	public double getCompanyMedicalInsuranceRate() {
		return this.companyMedicalInsuranceRate;
	}

	public void setCompanyMedicalInsuranceRate(double companyMedicalInsuranceRate) {
		this.companyMedicalInsuranceRate = companyMedicalInsuranceRate;
	}

	public double getCompanyUnemploymentInsuranceRate() {
		return this.companyUnemploymentInsuranceRate;
	}

	public void setCompanyUnemploymentInsuranceRate(double companyUnemploymentInsuranceRate) {
		this.companyUnemploymentInsuranceRate = companyUnemploymentInsuranceRate;
	}

	public double getPersonAccumulationFundRate() {
		return this.personAccumulationFundRate;
	}

	public void setPersonAccumulationFundRate(double personAccumulationFundRate) {
		this.personAccumulationFundRate = personAccumulationFundRate;
	}

	public double getPersonChildbirthInsuranceRate() {
		return this.personChildbirthInsuranceRate;
	}

	public void setPersonChildbirthInsuranceRate(double personChildbirthInsuranceRate) {
		this.personChildbirthInsuranceRate = personChildbirthInsuranceRate;
	}

	public double getPersonEmploymentInjuryInsuranceRate() {
		return this.personEmploymentInjuryInsuranceRate;
	}

	public void setPersonEmploymentInjuryInsuranceRate(double personEmploymentInjuryInsuranceRate) {
		this.personEmploymentInjuryInsuranceRate = personEmploymentInjuryInsuranceRate;
	}

	public double getPersonEndowmentInsuranceRate() {
		return this.personEndowmentInsuranceRate;
	}

	public void setPersonEndowmentInsuranceRate(double personEndowmentInsuranceRate) {
		this.personEndowmentInsuranceRate = personEndowmentInsuranceRate;
	}

	public double getPersonMedicalInsuranceRate() {
		return this.personMedicalInsuranceRate;
	}

	public void setPersonMedicalInsuranceRate(double personMedicalInsuranceRate) {
		this.personMedicalInsuranceRate = personMedicalInsuranceRate;
	}

	public double getPersonUnemploymentInsuranceRate() {
		return this.personUnemploymentInsuranceRate;
	}

	public void setPersonUnemploymentInsuranceRate(double personUnemploymentInsuranceRate) {
		this.personUnemploymentInsuranceRate = personUnemploymentInsuranceRate;
	}

	public String getSocialSecurityTypeName() {
		return this.socialSecurityTypeName;
	}

	public void setSocialSecurityTypeName(String socialSecurityTypeName) {
		this.socialSecurityTypeName = socialSecurityTypeName;
	}

	public List<SocialSecurity> getSocialSecurities() {
		return this.socialSecurities;
	}

	public void setSocialSecurities(List<SocialSecurity> socialSecurities) {
		this.socialSecurities = socialSecurities;
	}

	public SocialSecurity addSocialSecurity(SocialSecurity socialSecurity) {
		getSocialSecurities().add(socialSecurity);
		socialSecurity.setSocialSecurityType(this);

		return socialSecurity;
	}

	public SocialSecurity removeSocialSecurity(SocialSecurity socialSecurity) {
		getSocialSecurities().remove(socialSecurity);
		socialSecurity.setSocialSecurityType(null);

		return socialSecurity;
	}

}